#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        // 操作对象
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery;

        form.on('submit(sub)', function(data){

            util.sendAjax ({
                type: 'POST',
                url: '#(ctxPath)/app/OrgStructure/postAddPerson',
                data: $('#addForm').serialize(),
                loadFlag: true,
                success : function(data){
                    pop_close();
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
        $("#batch").click(function () {
            window.location.href = '#(ctxPath)/app/OrgStructure/batchInvite?orgType=#(orgType)&structID=#(id)';
        });
    });
</script>
#end

#define content()
<div class="x-body">
    <form id="addForm" class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>架构编号</label>
            <div class="layui-input-block">
                <input type="text" name="applyInvite.structID" placeholder="" class="layui-input layui-disabled" value="#(id)" required  lay-verify="required" autocomplete="off" readonly="readonly"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>架构名称</label>
            <div class="layui-input-block">
                <input type="text" name="" placeholder="" class="layui-input layui-disabled" value="#(orgStructName)" autocomplete="off" disabled/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>组织类型</label>
            <div class="layui-input-block">
                <!--<input type="text" name="orgstructure.orgType" placeholder="" class="layui-input" value="" required  lay-verify="required" autocomplete="off"/>-->
                <select name="orgType" readonly="readonly">
                    <option value="0" #(orgType =='0'?'selected':'disabled')>管理机构</option>
                    <option value="1" #(orgType =='1'?'selected':'disabled')>企业机构</option>
                    <option value="2" #(orgType =='2'?'selected':'disabled')>服务机构</option>
                    <option value="3" #(orgType =='3'?'selected':'disabled')>审查团体</option>
                    <option value="4" #(orgType =='4'?'selected':'disabled')>专业团体</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>人员帐号</label>
            <div class="layui-input-block">
                <input type="text" name="applyInvite.name" placeholder="" class="layui-input" value="" required  lay-verify="required" autocomplete="off"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button  class="layui-btn" lay-filter="sub" lay-submit>邀请加入</button>
            <button id="batch" class="layui-btn layui-btn-primary">批量邀请</button>
        </div>
    </form>
</div>
#end